package com.quanyan.place.enums;

import com.quanyan.common.enums.BaseEnum;

/**
 * Created by Kingson.chan on 2016/6/30 0030.
 */

/**
 * 场馆错误码以100(系统编号)开头，加三位错误编号，例如100001
 */

public enum  PlaceErrorCodeEnum implements BaseEnum {
    TOKEN_EXPIRED(100001, "TOKEN_EXPIRED", "请重新登录！" , false),
    ORDER_SYSTEM_ERROR(100002, "ORDER_SYSTEM_ERROR", "调用订单系统异常！" , false),
    ASSETS_SYSTEM_ERROR(100003, "ASSETS_SYSTEM_ERROR", "调用资产系统异常！" , false),
    CARD_DOES_NOT_EXIST(100004, "CARD_DOES_NOT_EXIST", "会员卡不存在！" , false),
    BALANCE_NOT_ENOUGH(100005, "BALANCE_NOT_ENOUGH", "该会员卡余额不足，请选择其他方式支付。" , false),
    ORDER_MONEY_IS_ZERO(100006, "ORDER_MONEY_IS_ZERO", "订单金额为0，订场无效。" , false),
    CARD_IS_EXPIRED(100007, "CARD_IS_EXPIRED", "会员卡不能在该时段使用。" , false),
    TICKET_ERROR(100008, "TICKET_ERROR", "会员卡支付写入失败。" , false),
    TICKET_NOT_ENOUGH(100009, "TICKET_NOT_ENOUGH", "会员卡次数不足。" , false),
    COUPON_SYSTEM_ERROR(100010, "COUPON_SYSTEM_ERROR", "获取优惠券列表异常！" , false),
    BUNDLE_NOT_PRICE_ERROR(100011, "BUNDLE_ERROR", "此场馆运动项目还没有定价！" , false),
    TICKET_NOT_TIME(100012, "TICKET_NOT_TIME", "门票没有被绑定。" , false),
    TICKET_STATS_FAIL(100013, "TICKET_STATS_FAIL", "门票统计失败。" , false),
    COUPON_NOT_USE(100018, "COUPON_NOT_USE", "该优惠券不可用，请升级最新版本使用！" , false),
    /** 订单轮询返回 **/
    ORDER_ID_REQUIRED(100014,"ORDER_NO_REQUIRED","订单号必需",false),
    ORDER_IS_EMPTY(100015,"ORDER_IS_EMPTY","查无此订单",false),
    ORDER_WAIT_PAY(100016,"ORDER_WAIT_PAY","等待支付",false),
    ORDER_SUCCESS_PAY(100017,"ORDER_SUCCESS_PAY","支付成功",true),
    TICKET_PAY_CONFIG_ERROR(21012, "TICKET_PAY_CONFIG_ERROR", "当前支付方式不可用，请使用其他支付方式或稍后再试" , false),

    /** 优惠券折扣，为兼容老版本**/
    COUPON_DISCOUNT_PAY_ERROR(21013, "TICKET_PAY_CONFIG_ERROR", "该优惠券抵扣金额为0，请选择其他优惠券" , false),
    /** 商品库存不足**/
    GOODS_INVENTORY_NOT_ENOUGH(21014, "GOODS_INVENTORY_NOT_ENOUGH", "商品库存不足" , false),
    ;

    protected int id;

    protected String code;

    protected String label;

    protected boolean success;

    PlaceErrorCodeEnum(int id, String code, String label, boolean success) {
        this.id = id;
        this.code = code;
        this.label = label;
        this.success = success;
    }


    @Override
    public int getId() {
        return id;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getLabel() {
        return label;
    }

    @Override
    public boolean isSuccess() {
        return success;
    }

}
